<include file="Public/_meta" />

<title>添加银行</title>
</head>
<body>
<article class="page-container">
	<form action="" method="post" class="form form-horizontal" id="form-bank-alert">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>银行名称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="hidden" value="{$bank.bank_id}"  name="bankid">
				<input type="text" class="input-text" value="{$bank.bank_name}" placeholder="" id="username" name="bankname">
			</div>
		</div>
		<!--<div class="row cl">-->
		<!--	<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>所属区域：</label>-->
		<!--	<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">-->
		<!--		<select class="select" size="1"  name="place">-->
		<!--			<option value="" selected>请所属区域</option>-->
		<!--			<volist name="place" id="val">-->
		<!--				<option value="{$key}" <if condition="$key eq $bank['place']">selected</if>>{$val}</option>-->
		<!--			</volist>-->
		<!--		</select>-->
		<!--		</span> </div>-->
		<!--</div>-->
				<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">所属上一级：</label>
			<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
				<select class="select" size="1" name="pid">
					<option value="" selected>请选择所属上级，总行不需要选择</option>
					<volist name="banks" id="val">
						<option value="{$val.bank_id}" <if condition="$val['bank_id'] eq $bank['pid']">selected</if>>{$val.bank_name}</option>
					</volist>
				</select>
				</span> </div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>
<include file="Public/_footer" />
<script type="text/javascript">
var index = parent.layer.getFrameIndex(window.name)
$("#form-bank-alert").submit(function(){
	$(".radius").attr('type','button');
        $.ajax({
          url:'{:U("Bank/editCheck")}',
          type:'post',
          data:$('#form-bank-alert').serialize(),
          dataType:'json',
          success:function(data){
            if(data.ResultCode == '200'){
              layer.msg(data.ResultMessage,{time:1000},function(){
                  parent.window.location.reload()
                  parent.layer.close(index);
              });
            }
            else if(data.ResultCode == '500'){
                layer.msg(data.ResultMessage,{time:1000},function(){

                })
            }
          }
        })
        return false;
	});
</script>
</body>
</html>
